//
//  DBUtil.h
//  SC
//
//  Created by nhn on 14-8-6.
//  Copyright (c) 2014年 CNUIC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"

@interface DBUtil : NSObject

+ (void)openDBIfNeed;

+ (void)closeDBIfNeed;

+ (NSArray*)query:(NSString*)sql, ...;

+ (BOOL)update:(NSString*)sql, ...;

// Only method of FMDatabase should be used in block, not DBUtil's
+ (void)openDBWithBlock:(void(^)(FMDatabase* database))block;

+ (void)printQuery:(NSString*)sql;

@end
